package com.mk.admin.controller;

import com.mk.admin.model.ResultDto;
import com.mk.admin.model.vo.QuestionTypeVo;
import com.mk.admin.service.QuestionTypeService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/a/adm/questionType")
@Api(tags = "常见问题类型")
public class QuestionTypeController {
    @Autowired
    private QuestionTypeService questionTypeService;

    @PostMapping("/select")
    public ResultDto select(@RequestBody QuestionTypeVo vo) {
        return questionTypeService.select(vo);
    }

    @PostMapping("/add")
    public ResultDto add(@RequestBody QuestionTypeVo vo) {
        return questionTypeService.add(vo);
    }

    @PostMapping("/update")
    public ResultDto update(@RequestBody QuestionTypeVo vo) {
        return questionTypeService.update(vo);
    }

    @PostMapping("/delete")
    public ResultDto delete(@RequestBody QuestionTypeVo vo) {
        return questionTypeService.delete(vo.getId());
    }

    @PostMapping("/status")
    public ResultDto status(@RequestBody QuestionTypeVo vo) {
        return questionTypeService.status(vo.getId());
    }
}
